home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _42F714A742384FE3AD54CC51F0D0FB72 < prev    next >
Encoding:
Text File  |  2004-01-06  |  3.5 KB  |  116 lines

  1. -- E3Greeter Behaviour SCRIPT
  2. --------------------------
  3.  
  4. AIBehaviour.E3Greeter = {
  5.     Name = "E3Greeter",
  6.     pathname = "",
  7.  
  8.     State = 0,
  9.     Greeted = 0,
  10.  
  11.     Sounds = {
  12.         hey = Sound:Load3DSound("Sounds/e3ai/hey.wav"),
  13.         wait = Sound:Load3DSound("Sounds/e3ai/wait.wav"),        
  14.     },
  15.  
  16.  
  17.     OnSpawn = function(self,entity )
  18.  
  19.         AI:CreateGoalPipe(entity:GetName().."walk");
  20.         AI:PushGoal(entity:GetName().."walk","bodypos",0,0);
  21.         AI:PushGoal(entity:GetName().."walk","run",0,0);
  22.         AI:PushGoal(entity:GetName().."walk","pathfind",1,entity.Properties.pathname);
  23.         AI:PushGoal(entity:GetName().."walk","trace",1,1);
  24.  
  25.  
  26.         -- copy this line to OnActivate if you want to activate this guy with a 
  27.         -- proximity trigger
  28.         ---------
  29.     end,
  30.     --------------------------------------------------------------------------------------------
  31.     OnActivate = function(self,entity )
  32.  
  33.         -- if you want the guy to start moving along path after he hit a activation
  34.         -- proximity trigger, just copy the last line of OnSpawn here
  35.         entity:SelectPipe(0,entity:GetName().."walk");                
  36.     end,
  37.     ---------------------------------------------
  38.     OnPlayerSeen = function( self,entity )
  39.  
  40.         if (entity.Behaviour.Greeted == 0) then
  41.             entity:SelectPipe(0,"misunderstood");
  42.             entity.Behaviour.Greeted = 1;
  43.         end
  44.     end,
  45.     ---------------------------------------------
  46.     OnEnemyMemory = function(self,entity )
  47.  
  48.     end,
  49.     ---------------------------------------------
  50.     OnReceivingDamage = function (self,entity, sender)
  51.         System:Log(entity:GetName().." (DEFAULT) AIEVENT - OnReceivingDamage");
  52.  
  53.         entity:StartAnimation(0,"spain_stun");
  54.         entity:SelectPipe(0,"standfire");
  55.     
  56.         if (entity.Behaviour.State == 0) then
  57.             entity:SelectPipe(0,"fumbleforweapon");
  58.         else
  59.             entity:SelectPipe(0,"inpaincycle");
  60.         end
  61.         
  62.     end,
  63.     ---------------------------------------------
  64.     OnInterestingSoundHeard = function(self,entity )
  65.     end,
  66.     ---------------------------------------------
  67.     OnThreateningSoundHeard = function( self,entity )
  68.     end,
  69.     ---------------------------------------------
  70.  
  71.  
  72.  
  73.  
  74.     -- CUSTOM SIGNALS
  75.     -----------------------------------------------------------------
  76.     PlayFumbleAnimation = function( self,entity )    
  77.         entity:StartAnimation(0,"sreload");
  78.     end,
  79.     -----------------------------------------------------------------
  80.     NowStandAndFire = function(self, entity )    
  81.  
  82.         entity:SelectPipe(0,"standfire");
  83.     end,
  84.     -----------------------------------------------------------------
  85.     GreetAndSayNiceToMeetYou = function(self, entity )    
  86.         entity:StartAnimation(0,"ssignal_sgreet");
  87.  
  88.         -- #Steve: Play sound here: "Hey, am I glad to see you guys"
  89.         entity:Say(entity.Behaviour.Sounds.hey);
  90.         System:LogToConsole("Hey, am I glad to see you guys");
  91.     end,
  92.     -----------------------------------------------------------------
  93.     OhShitItsTheSkipper = function(self, entity )    
  94.         entity:StartAnimation(0,"ssurprise");
  95.  
  96.         -- #Steve: Play sound here: "Hold on a secà shit"
  97.         entity:Say(entity.Behaviour.Sounds.wait);
  98.         System:LogToConsole("Hold on a secà shit");
  99.     end,
  100.     -----------------------------------------------------------------
  101.     GetYourWeaponOut = function(self, entity )    
  102.         entity:SelectPipe(0,"fumbleforweapon");
  103.         -- #Steve: Play sound here: some grunting sound
  104.     end,
  105.     -----------------------------------------------------------------
  106.     WeaponDrawn = function(self, entity )
  107.         entity.Behaviour.State = 1;
  108.         if (entity.Behaviour.LOS == 1) then
  109.             entity:StartAnimation(0,"sidleaim_loop");
  110.             entity:SelectPipe(0,"standfire");
  111.         end
  112.     end,
  113.  
  114.  
  115.  
  116. }